package com.example.demo.zabbix.request.builder.host;

import com.example.demo.zabbix.request.BaseRequest;
import com.example.demo.zabbix.request.builder.request.RequestBuilder;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/hostgroup/massremove
 */
public class HostGroupMassRemoveRequestBuilder extends RequestBuilder<Map<String,Object>> {
    private List<String> groupIds;
    public HostGroupMassRemoveRequestBuilder(String auth) {
        super("hostgroup.massremove", auth);
        baseRequest.setParams(new HashMap<>());
    }

    public HostGroupMassRemoveRequestBuilder(Long id, String auth) {
        super("hostgroup.massremove", id, auth);
        baseRequest.setParams(new HashMap<>());
    }

    public List<String> getGroupIds() {
        return groupIds;
    }

    public HostGroupMassRemoveRequestBuilder setGroupIds(List<String> groupIds) {
        this.groupIds = groupIds;
        return this;
    }

    public HostGroupMassRemoveRequestBuilder setParam(String key, Object value){
        baseRequest.getParams().put(key,value);
        return this;
    }

    public HostGroupMassRemoveRequestBuilder setParams(Map<String,Object> params){
        baseRequest.getParams().putAll(params);
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("groupids",groupIds);
        return baseRequest;
    }
}
